#include <stdio.h>
int main(void) {
  char c;
  // 0: first char
  // 1: started with 0
  // 2: started with + or -
  // 3: inner
  // 4: outer
  // -1: reset
  // -2: wait next \n or EOF
  int stage = 0;
  while ((c = getchar()) != EOF) {
    if (stage == -1) {
      // reset
      stage = 0;
    }
    //printf("Stage %d: %c\n", stage, c);
    switch(stage) {
      case -2:
        if (c == '\n' || c == '\0') {
          stage = -1;
        }
        break;
      case 0:
        // Accept: +- and 0-9 and space
        if (c == '+' || c == '-') {
          stage = 2;
        } else if (c == '0') {
          stage = 1;
        } else if (c >= '1' && c <= '9') {
          stage = 3;
        } else if (c == ' ') {
          // noop
        } else if (c == '\n' || c == '\0') {
          printf("No\n");
          stage = -1;
        } else {
          printf("No\n");
          stage = -2;
        }
        break;
      case 1:
        // Accept: 0 and space
        if (c == '0') {
          // noop
        } else if (c == ' ') {
          stage = 4;
        } else if (c == '\r') {
          // Windows \r\n
          printf("Yes\n");
          stage = -2;
        } else if (c == '\n' || c == '\0') {
          printf("Yes\n");
          stage = -1;
        } else {
          printf("No\n");
          stage = -2;
        }
        break;
      case 2:
        // Accept: 0-9 and space
        if (c == ' ') {
          // noop
        } else if (c == '0') {
          // fast terminate
          stage = 1;
        } else if (c >= '1' && c <= '9') {
          stage = 3;
        } else if (c == '\r') {
          // Windows \r\n
          printf("No\n");
          stage = -2;
        } else if (c == '\n' || c == '\0') {
          printf("No\n");
          stage = -1;
        } else {
          printf("No\n");
          stage = -2;
        }
        break;
      case 3:
        // Accept: 0-9 and space
        if (c >= '0' && c <= '9') {
          // noop
        } else if(c == ' ') {
          stage = 4;
        } else if (c == '\r') {
          // Windows \r\n
          printf("Yes\n");
          stage = -2;
        } else if (c == '\n' || c == '\0') {
          printf("Yes\n");
          stage = -1;
        } else {
          printf("No\n");
          stage = -2;
        }
        break;
      case 4:
        // Accept: space
        if (c == ' ') {
          // noop
        } else if (c == '\r') {
          // Windows \r\n
          printf("Yes\n");
          stage = -2;
        } else if (c == '\n' || c == '\0') {
          printf("Yes\n");
          stage = -1;
        } else {
          printf("No\n");
          stage = -2;
        }
        break;
    }
  }
}
